<cfcomponent extends="BaseGenerator" hint="Generate directory structure">
	<cffunction name="init">
		<cfreturn this />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createAllDirectories">
		<cfargument name="context_name" required="true" type="String" />
		
	
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createContext">
		<cfargument name="context_name" required="true" type="String" />
		
		<cfset setTurbineProperties(arguments.context_name) />
		<cfset generateDirectory(super.getTurbineProperty("ContextPath"), "context", "Created Context") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createUtilsDir">
		<cfset generateDirectory("#super.getTurbineProperty('BasePath')#/utils", "utils_dir", "Created directory for application utilities (utils)") />
		
		<cfreturn true />
	</cffunction>
	
	
	<cffunction access="public" returntype="boolean" name="createBaseDir">
		<cfset generateDirectory(super.getTurbineProperty("basePath"), "app_dir", "Created base path 'app'") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createModelDir">
		<cfset generateDirectory(super.getTurbineProperty("modelPath"), "model", "Created 'model' directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createViewDir">
		<cfargument name="table_name" required="true" type="String" />
		
		<cfset generateDirectory(super.getTurbineProperty("ViewPath"), "view_dir", "Created base path 'app'") />
		<cfset generateDirectory('#super.getTurbineProperty("ViewPath")#/#arguments.table_name#', "#arguments.table_name#", "Created view sub-directories") />
		<cfreturn true />
	</cffunction>
		
	<cffunction access="public" returntype="boolean" name="createControllerDir">
		<cfset generateDirectory(super.getTurbineProperty("ControllerPath"), "controller_dir", "Created 'model' directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createDAODir">
		<cfset generateDirectory("#super.getTurbineProperty('BasePath')#/dao", "dao_dir", "Created directory for application dao(dao)") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createLayout">
		<cfset generateDirectory(super.getTurbineProperty("viewPath") & "/layout", "layout_dir", "Created layout directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createMigrationsDir">
		<cfset generateDirectory(super.getTurbineProperty("MigrationsPath"), "migration_dir", "Created 'model' directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createPublicDir">
		<cfset generateDirectory(super.getTurbineProperty("clientSideStuffDir"), "public_dir", "Created base path 'app'") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createJSDir">
		<cfset generateDirectory(super.getTurbineProperty("jsPath"), "js_dir", "Created base path 'app'") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createImagesDir">
		<cfset generateDirectory(super.getTurbineProperty("imagesPath"), "images_dir", "Created 'model' directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="public" returntype="boolean" name="createCSSDir">
		<cfset generateDirectory(super.getTurbineProperty("cssPath"), "css_dir", "Created 'model' directory") />
		
		<cfreturn true />
	</cffunction>
	
	<cffunction access="private" returntype="boolean" name="generateDirectory">
		<cfargument name="creation_path" required="true" type="string" />
		<cfargument name="log_name" required="true" type="string" />
		<cfargument name="success_message" required="true" type="string" />
		<cfargument name="failure_message" default="Failed" type="string" />
		
		<cftry>
			<cfdirectory action="create" type="dir" directory="#arguments.creation_path#"  />
			<cfset super.WriteLog(arguments.log_name, "#arguments.success_message#") />
			<cfcatch type="any">
				<cfset super.WriteLog(arguments.log_name, '#arguments.failure_message#. Detail:#cfcatch.detail# Message:#cfcatch.Message#') />
			</cfcatch>
		</cftry>
		<cfreturn true />
	</cffunction>
</cfcomponent>